package lib;

import java.util.Calendar;
import java.util.Date;

public class Transaction 
{
	private Calendar dateOfTransaction;
	private double amount;
	
	public Transaction(Date date, double amountTransacted)
	{
		dateOfTransaction = Calendar.getInstance();
		this.setDateOfTransaction(date);
		this.setAmount(amountTransacted);
	}

	public void setDateOfTransaction(Date dateOfTransaction) 
	{
		this.dateOfTransaction.setTime(dateOfTransaction);
	}

	public Date getDateOfTransaction() {
		return dateOfTransaction.getTime();
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	public double getAmount() {
		return amount;
	}
	
	public String toString()
	{
		return dateOfTransaction.get(Calendar.DAY_OF_MONTH) + "/" + 
		dateOfTransaction.get(Calendar.MONTH) + "/"+ 
		dateOfTransaction.get(Calendar.YEAR) +" - $" + getAmount(); 
	}

	
}
